Skip to content

have cron jobs running only in upstream repo#3954

Closed
luiztauffer wants to merge 1 commit into
SpikeInterface:mainfrom
luiztauffer:cron-actions-upstream
Closed

have cron jobs running only in upstream repo#3954
luiztauffer wants to merge 1 commit into
SpikeInterface:mainfrom
luiztauffer:cron-actions-upstream

Conversation

@luiztauffer
Copy link
Copy Markdown
Collaborator

Some Actions are scheduled to run automatically following CRON rules, which might eventually incur in costs to anyone forking the repo. This adds a conditional to run these jobs only in the upstream repo.

@luiztauffer luiztauffer requested a review from Copilot May 26, 2025 15:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR restricts scheduled GitHub Actions workflows to run only in the upstream repository to prevent unnecessary executions on forked repositories.

  • Added a condition in multiple workflow YAML files to check for the upstream repository.
  • Updated workflows: test_kilosort4, installation-tips-test, full-test-with-codecov, caches_cron_job, and all-tests.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/test_kilosort4.yml Added condition to run workflow only in the upstream repository.
.github/workflows/installation-tips-test.yml Added condition to run workflow only in the upstream repository.
.github/workflows/full-test-with-codecov.yml Added condition to run workflow only in the upstream repository.
.github/workflows/caches_cron_job.yml Added condition to run workflow only in the upstream repository.
.github/workflows/all-tests.yml Added condition to run workflow only in the upstream repository.

@luiztauffer luiztauffer requested a review from alejoe91 May 26, 2025 15:42
@alejoe91
Copy link
Copy Markdown
Member

LGTM! @h-mayorquin @zm711 wanna have a look?

Copy link
Copy Markdown
Collaborator

@h-mayorquin h-mayorquin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This concern mainly applies to old forks.

According to the documentation:
GitHub Docs – Disabling and enabling a workflow

To prevent unnecessary workflow runs, scheduled workflows may be disabled automatically. When a public repository is forked, scheduled workflows are disabled by default. In a public repository, scheduled workflows are automatically disabled when no repository activity has occurred in 60 days.

In other words, scheduled workflows are disabled for inactive forks, and new forks do not run actions unless users explicitly opt in.

If you forked the repository after 2023, this should not be an issue, since GitHub changed the behavior around that time to make running actions opt-in:
GitHub Community Discussion

The trade-off:

  • It becomes a bit harder for users to test the actions on their own workflows (say, for testing the action itself).
  • But it also protects users with older forks from unintentionally running workflows.

I don't feel strongly about either way. If we go with this solution we should improve the comment though so that we remember that this is there to protect old forks.

@zm711
Copy link
Copy Markdown
Member

zm711 commented May 26, 2025

It becomes a bit harder for users to test the actions on their own workflows (say, for testing the action itself).

is the solution just for the fork owner to delete that line? If that's the case I agree we can improve the comment then put this through to help devs know how to get actions working on their fork if they want it. Otherwise this is good by me too.

@zm711 zm711 added the continuous integration Related to CI label May 27, 2025
@h-mayorquin
Copy link
Copy Markdown
Collaborator

We discussed this today.

The problem is that even if we merge this most people don't synchronize their local main with their origin main (the fork on github).

This means that this will not solve problem for most people and still has the cost of making it harder for forks that want to both run actions and keep in synch with us.

@luiztauffer
Copy link
Copy Markdown
Collaborator Author

yeah that makes sense, in retrospect, it could be that I have manually set my fork to run all actions for whatever reason in the past

@luiztauffer luiztauffer closed this Jun 5, 2025
@h-mayorquin
Copy link
Copy Markdown
Collaborator

h-mayorquin commented Jun 5, 2025

Here is a query to get repos that might be within the affected dates:

@samuelgarcia @alejoe91

gh api -H "Accept: application/vnd.github+json" /repos/SpikeInterface/spikeinterface/forks?per_page=100 --paginate | jq -r '
      .[] | select(.created_at >= "2020-01-01" and .created_at < "2023-12-01" and .updated_at > "2023-01-01") |
      {user: ("@" + .owner.login), name: .full_name, updated: .updated_at}' | jq -s 'sort_by(.updated) | reverse[] | "\(.user) \(.name) \(.updated)"' | column -t
"@yger                   yger/spikeinterface                   2025-06-04T07:02:20Z"
"@zm711                  zm711/spikeinterface                  2025-06-03T18:42:59Z"
"@chrishalcrow           chrishalcrow/spikeinterface           2025-05-21T09:09:40Z"
"@h-mayorquin            h-mayorquin/spikeinterface            2025-05-20T20:11:28Z"
"@catalystneuro          catalystneuro/spikeinterface          2025-05-13T00:31:35Z"
"@alejoe91               alejoe91/spikeinterface               2025-05-06T00:05:43Z"
"@cwindolf               cwindolf/spikeinterface               2025-04-14T17:02:29Z"
"@int-brain-lab          int-brain-lab/spikeinterface          2025-04-05T09:55:18Z"
"@JoeZiminski            JoeZiminski/spikeinterface            2025-03-14T18:04:39Z"
"@CSC-UW                 CSC-UW/spikeinterface                 2025-03-12T17:56:55Z"
"@maxjuv                 maxjuv/spikeinterface                 2025-02-27T14:59:09Z"
"@Antho2422              Antho2422/spikeinterface              2025-01-22T11:58:25Z"
"@grero                  grero/spikeinterface                  2024-09-24T04:28:35Z"
"@chris-langfield        chris-langfield/spikeinterface        2024-09-04T13:40:05Z"
"@iurillilab             iurillilab/spikeinterface             2024-07-04T16:00:54Z"
"@DradeAW                DradeAW/spikeinterface                2024-06-05T11:27:57Z"
"@robyngreene            robyngreene/spikeinterface            2024-05-29T11:09:41Z"
"@EEGKit                 EEGKit/spikeinterface                 2024-01-02T05:27:46Z"
"@JunHao-Huang           JunHao-Huang/spikeinterface           2023-12-08T07:59:12Z"
"@pantelisantonoudiou    pantelisantonoudiou/spikeinterface    2023-11-27T15:05:01Z"
"@rory-bedford           rory-bedford/spikeinterface           2023-11-15T16:17:38Z"
"@fazledyn-or            fazledyn-or/spikeinterface            2023-11-13T09:44:27Z"
"@sudhasharma529         sudhasharma529/spikeinterface         2023-10-22T19:46:19Z"
"@skeltoh                skeltoh/spikeinterface                2023-10-18T13:42:22Z"
"@gurinca                gurinca/spikeinterface                2023-10-07T01:38:25Z"
"@munahaf                munahaf/spikeinterface                2023-09-20T06:58:13Z"
"@Chetank99              Chetank99/spikeinterface              2023-09-13T11:09:10Z"
"@FelixAntonSchneider    FelixAntonSchneider/spikeinterface    2023-09-01T12:27:37Z"
"@valejandracch          valejandracch/spikeinterface          2023-08-18T14:02:48Z"
"@rdzakpasu              rdzakpasu/spikeinterface              2023-08-17T21:54:58Z"
"@tjr1                   tjr1/spikeinterface                   2023-07-25T18:42:34Z"
"@JohnStout              JohnStout/spikeinterface              2023-07-20T19:43:00Z"
"@Tan-Lao                Tan-Lao/spikeinterface                2023-06-28T14:02:28Z"
"@taekjunkim             taekjunkim/spikeinterface             2023-06-21T18:33:25Z"
"@oaaij-gnahz            oaaij-gnahz/spikeinterface            2023-05-04T16:49:44Z"
"@timsainb               timsainb/spikeinterface               2023-04-26T18:39:53Z"
"@LaurenzMuessig         LaurenzMuessig/spikeinterface         2023-04-21T08:24:08Z"
"@cristofer-holobetz     cristofer-holobetz/spikeinterface     2023-04-20T01:32:22Z"
"@bramn22                bramn22/spikeinterface                2023-04-17T10:33:46Z"
"@NDolensek              NDolensek/spikeinterface              2023-03-20T18:41:29Z"
"@surygeng               surygeng/spikeinterface               2023-03-20T18:41:29Z"
"@ToGauvrit              ToGauvrit/spikeinterface              2023-03-16T06:32:11Z"
"@RPanskus               RPanskus/spikeinterface               2023-03-11T21:10:40Z"
"@zhang3xing1            zhang3xing1/spikeinterface            2023-03-02T10:28:18Z"
"@bendichter             bendichter/spikeinterface             2023-02-26T15:05:27Z"
"@rob-luke               rob-luke/spikeinterface               2023-02-22T09:20:06Z"
"@andrei8782             andrei8782/spikeinterface             2023-02-14T20:35:24Z"
"@pauladkisson           pauladkisson/spikeinterface           2023-02-09T19:58:02Z"
"@kurtulusbulus          kurtulusbulus/spikeinterface          2023-02-03T19:22:26Z"
"@JaerongA               JaerongA/spikeinterface               2023-02-02T18:59:25Z"
"@lysts                  lysts/spikeinterface                  2023-01-31T16:39:15Z"
"@Moritz-Alexander-Kern  Moritz-Alexander-Kern/spikeinterface  2023-01-19T13:33:33Z"
"@juliencarponcy         juliencarponcy/spikeinterface         2023-01-13T16:07:10Z"

created before the github decisions and recently activate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants